Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp becomes invalidly formed if clock is unset #304

Open
SRGDamia1 opened this issue Jan 15, 2020 · 1 comment
Open

Timestamp becomes invalidly formed if clock is unset #304

SRGDamia1 opened this issue Jan 15, 2020 · 1 comment

Comments

@SRGDamia1
Copy link
Contributor

A completely unset DS3231 has a 2000-epoch timestamp of 0. Adding a negative offset to correct to LST puts that time at less than 0. Converting the less-than-0 timestamp to text gives an invalidly formed text string so uploads to MonitorMW will be rejected.

In cases where the clock is unfixably incorrect, the output text timestamp should be at least correctly formed so as to be uploadable, even if not correct.

SRGDamia1 referenced this issue Jan 15, 2020
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
@neilh10
Copy link

neilh10 commented Mar 6, 2020

If the time is invalid, how about setting the default time to 2020Jan02 00:00
that way it covers all the problems with time shifting as well as default DS3231.
I would suggest using defines
#define EPOCH_TIME_20200101_SECS 1577836800
#define EPOCH_TIME_20200102_SECS 1577923200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants